package com.cloud.alibaba.config;

import com.alibaba.csp.sentinel.adapter.servlet.callback.WebCallbackManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 刘志强
 * @date 2020/9/27 09:16
 */

@Configuration
public class SentinelConfig {

    @Bean
    public MyUrlBlockHandler webCallbackManager() {
        MyUrlBlockHandler myUrlBlockHandler = new MyUrlBlockHandler();
        WebCallbackManager.setUrlBlockHandler(myUrlBlockHandler);
        return myUrlBlockHandler;
    }
}
